package com.tingyuge.thinking.spring.configuration.bean.scope.web;

import com.tingyuge.thinking.spring.ioc.overview.domain.User;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.context.annotation.ApplicationScope;
import org.springframework.web.context.annotation.RequestScope;
import org.springframework.web.context.annotation.SessionScope;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;

/**
 * web mvc 配置类
 * @author xiaodao
 * @version 1.0
 * @date 2021/7/5
 */
@Configuration
@EnableWebMvc
public class WebConfiguration {

    @Bean
//    @RequestScope
//    @SessionScope
    @ApplicationScope
    public User user(){
        User user = new User();
        user.setId(1l);
        user.setName("xiaodao");
        return user;

    }
}
